<?php 

$titulos = '';
$valors = '';


$status_ctte = array();
$status_masc = array();

foreach ($clienteStatus as $clienteStatu){
    
    ${'status_ctte'.$clienteStatu->getZonId().'s'.$clienteStatu->getSta()} = $clienteStatu->getTotal();
    ${'status_masc'.$clienteStatu->getZonId().'s'.$clienteStatu->getSta()} = $clienteStatu->getMasc();
    

}



    ?>

 
<table border="0" cellpanding="0" cellspacing="0" class=" tableReport " >
    
    <tr>
        <td style="text-align: center">
            <h1> Clientes agrupados por Zonas con clientes (<?php echo count($clienteReportes)?>)</h1>
        </td>
    </tr>
<tr>
        <td>
<table id="tablesorter-demo" border="0" cellpanding="0" cellspacing="0" class="tablesorter">
    
  
    
    <thead>
        <tr>
        <td colspan="4" style="text-align: center; text-transform: uppercase; font-size: 10px; background: #cccccc; padding: 10px"> Datos Generales</td>
        <?php foreach ($status as $statu) { 
            if($statu->getId()!=5){?>
        <td colspan="2" style="text-align: center; text-transform: uppercase;font-size: 10px; background: <?php echo $statu->getColorFondo() ?>; color:<?php echo $statu->getColorFuente() ?>; padding: 10px"><?php echo $statu->getNombre() ?></td>
        <?php }} ?>
        </tr>
    </tr>
    <tr>
        <th class="titleReport" width="50px">Puesto</th>
        <th class="titleReport" width="100px">Zonas</th>
        <th class="titleReport" width="100px">#Ctte</th>
        <th class="titleReport" width="100px">#P</th>
        
        
        <?php foreach ($status as $statu) { 
            
            if($statu->getId()!=5){?>
        
        <th class="titleReport" width="100px">#Ctte</th>
        <th class="titleReport" width="100px">#P</th>
        <?php }} ?>
        
    
    </tr>
    </thead>
    <tbody>
    <?php 
    $count = 1;
    foreach ($clienteReportes as $clienteReporte){ ?>
    <tr>
        <td class="lineaReport" align="center">
            <?php echo $count++;?>
        </td>
        
        <td class="lineaReport" align="center">
            <?php echo $clienteReporte->getZon();?>
        </td>
        
        <td class="lineaReport" align="center">
            <?php echo $clienteReporte->getTotales();?>
        </td>
        
        <td class="lineaReport" align="center">
            <?php echo $clienteReporte->getMasces();?>
        </td>
        <?php foreach ($status as $statu) { 
            
            if($statu->getId()!=5){
            ?>
        
        

        <td class="lineaReport" align="center">
            <!--[<?php echo $clienteReporte->getZonId(); ?>]-->
            <!--[<?php echo $statu->getId(); ?>]-->
            <?php echo ${'status_ctte'.$clienteReporte->getZonId().'s'.$statu->getId()};?>
        </td>
        <td class="lineaReport" align="center"><?php echo ${'status_masc'.$clienteReporte->getZonId().'s'.$statu->getId()};?></td>
            <?php } } ?>
    </tr>
    
    <?php }?>
    
    
    
    
 
    
    
    </tbody>
</table>
    
        </td>
    </tr>
     </table>       
  
  
  <script type="text/javascript">
	$(function() {		
		$("#tablesorter-demo").tablesorter();
		//$("#options").tablesorter({sortList: [[0,0]], headers: { 3:{sorter: false}, 4:{sorter: false}}});
	});	

  
  
  </script>
  